package test.eight.music3;
import static util.Util.*;
import test.eight.Note;

class Instrument{
	void play(Note n){print("Instrument.play()"+n);}
	String what(){return "Instrument.play()";}
	void adjust(){print("adjusting Instrument");}
}
class Wind extends Instrument{
	void play(Note n){print("Wind.play()"+n);}
	String what(){return "Wind.play()";}
	void adjust(){print("adjusting Wind");}
}
class Precussion extends Instrument{
	void play(Note n){print("Precussion.play()"+n);}
	String what(){return "Precussion.play()";}
	void adjust(){print("adjusting Precussion");}
}
class Stringed extends Instrument{
	void play(Note n){print("Stringed.play()"+n);}
	String what(){return "Stringed.play()";}
	void adjust(){print("adjusting Stringed");}
}

class Brass extends Wind{
	void play(Note n){print("Brass.play()"+n);}
	void adjust(){print("adjusting Brass");}
}
class WoodWind extends Wind{
	void play(Note n){print("WoodWind.play()"+n);}
	String what(){return "adjusting WoodWind";}
}

public class Music3 {
	public static void tune(Instrument i){
		i.play(Note.MIDDLE_C);
	}
	public static void tuneAll(Instrument[] e){
		for(Instrument i:e)
			tune(i);
	}
	
	public static void main(String[] args) {
		Instrument[] orchestra={
			new Wind(),
			new Precussion(),
			new Stringed(),
			new Brass(),
			new WoodWind()
		};
		tuneAll(orchestra);
	}
}
